<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>页面选择</title>

    <script TYPE="text/javascript" src="js/jquery-1.8.3.js"></script>
</head>

<body>
    <div id="rent">
        <input id="rents">
    </div>
    <div class="pageNum">
        <ul>

        </ul>
    </div>
</body>
<script type="text/javascript">
    var pid="";
    var html = "";
    $(function(){

        $.ajax({
            async : false,
            cache : false,
            type : 'POST',
            contentType : 'application/json',
            dataType:"json",
            url : "test" ,
            error : function() {
                alert('出错了');
                frameElement.api.close();
            },
            success : function(data) {

                debugger;
                for (var j=0;j<data.length;j++){
                    var map1=data[j];
                    var rent1=map1.ais_rent_unit;
                    if ( rent1!='' && rent1!=null){
                        $("#rents").val(map1.ais_rent_unit);
                        pid=map1.pid;
                    }

                }
                for (var i=0;i<data.length;i++){
                    var map = data[i];
                    var rent=map.ais_rent_unit;
                    if ( rent!='' && rent!=null){

                    } else {
                        html += "<li><a href=\"update?id=" + map.id + "&code="+map.house_code+"&pid="+pid+"\">" + map.address + "-----"+map.house_code+"</a></li>";
                    }
                    $(".pageNum ul").html(html);
                }

            }
        });
    })
</script>
</html>